﻿#include "servertimesync.h"
#include <QDateTime>

ServerTimeSync::ServerTimeSync() :diff_time_(0)
{
}

void ServerTimeSync::setTimeLen(qint64 time_len)
{
    diff_time_ = time_len;
}

qint64 ServerTimeSync::getServerTime()
{
    return QDateTime::currentMSecsSinceEpoch() + diff_time_;
}

void ServerTimeSync::invalidate()
{
    diff_time_ = 0;
}
